      integer itmp(12),itmp0(12)

C**** For the station Hohenpeissenberg, replace the GHCN data (fort.2)
C**** by the more complete data (fort.1) obtained from Hans Erren  via
C**** email on 7/2003.  The program assumes that the IDs (incl.year)
C**** are ordered numerically low->high in both input files
C****
      open(1,file='v2.hohenpeissenberg',form='formatted')
      open(2,file='v2.meanz',form='formatted')
      open(12,file='v2.mean',form='formatted')

!                                       CountryCode,ID,year,T-data
      read(1,'(i3,i9,i4,12i5)',end=100) icc0,id0,iyr0,itmp0 ! read Hoh.d
!!    idh=id0
   20 read(2,'(i3,i9,i4,12i5)',end=200) icc,id,iyr,itmp     ! read GHCN

      if(id/10.ne.id0/10.or.icc.ne.617) then
C****   just copy non-Hohenpeissenberg stations
         write (12,'(i3,i9.9,i4,12i5)') icc,id,iyr,itmp !
         go to 20
      end if

      if(id/10.eq.id0/10) then
C**** id-GHCN=id-Hohen: merge in Hohenpeissenberg data from email
   30    write (12,'(i3,i9.9,i4,12i5)') icc0,id0,iyr0,itmp0
!!       write(*,'(a6,i9,i5,12i5)') 'hohen ',id0,iyr0,itmp0
         read(1,'(i3,i9,i4,12i5)',end=100) icc0,id0,iyr0,itmp0
         go to 30
      end if

c**** No more email data - copy remaining GHCN data
  100 if(icc.ne.icc0.or.id.gt.id0.or.iyr.gt.iyr0) then
        write(12,'(i3,i9.9,i4,12i5)') icc,id,iyr,itmp
!!      if(id.eq.idh) write (*,'(i6,i9,i5,12i5)') icc,id,iyr,itmp
      end if
      read(2,'(i3,i9,i4,12i5)',end=200) icc,id,iyr,itmp
      go to 100

  200 stop
      end
